﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _08_EF
{
    public class BirdConfig : IEntityTypeConfiguration<Brid>
    {
        public void Configure(EntityTypeBuilder<Brid> builder)
        {
            builder.ToTable("T_Brids");
            // 设置主键
            builder.HasKey(b => b.Num);
            // 设置默认值
            builder.Property(b => b.Name).HasDefaultValue("aggie");
            
        }
        
    }
}
